Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction "SilentlyContinue"

function Set-RemoteAdministratorAccessDenied-True()
{
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") > $null

    # get content web service
    $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
    # turn off remote administration security
    $contentService.RemoteAdministratorAccessDenied = $true
   $contentService.Update()         
}

Set-RemoteAdministratorAccessDenied-True

Write-Host " "
Write-Host "Completed.  Any key to exit..."
Read-Host
